package cheme.ProcessModel;

import org.eclipse.draw2d.geometry.Point;

import cheme.ProcessModel.Visitors.IModelVisitor;

public class ConsoleView extends AbstractChild implements ITranslatable, IXmlOperations
{
	private static final long serialVersionUID = 1L;
	protected Point location = null;

	private String message  = "";
	
	public ConsoleView(IModelElement parent) 
	{
		super(parent);		
	}
	
	@Override
	public Object accept(IModelVisitor visitor) {		
		return null;
	}
	
	public Point getLocation()
	{
		if(null == location)
		{
			location = new Point(0,660);
			//location = new Point(420,10);
		}
		
		return location;
	}
	
	public void setLocation(Point location)
	{
		if(!this.location.equals(location))
		{
			Point oldBounds = this.location;
			
			this.location = location;
	
			firePropertyChange(P_CONSTRAINT, oldBounds, location);
		}
	}

	public String getMessage() {
		
		return message;
	}
	
	public void setMessage(String message)
	{
		String oldValue = this.message;
		
		this.message = message;
		
		firePropertyChange(IPropertyAware.P_TEXT, oldValue, message);		
	}
	
	
	public void clearAll()
	{
		firePropertyChange(IPropertyAware.P_CLEAR,null,null);
	}

	public Object fromXml() {
		// TODO Auto-generated method stub
		return null;
	}

	public String toXml() {
		// TODO Auto-generated method stub
		return "";
	}

}
